import request from "../../api/request";
const market = "market";

// 电卡表单获取
export function listByPage(data) {
  return request({
    url: market + "/card/listByPage",
    method: "post",
    data: data || {}
  });
}
// 电卡新增
export function listSave(data) {
  return request({
    url: market + "/card/save",
    method: "post",
    data: data || {}
  });
}
// 电卡修改
export function listUpdate(data) {
  return request({
    url: market + "/card/update",
    method: "post",
    data: data || {}
  });
}

// 批量注销
export function updateBy(data) {
  return request({
    url: market + "/card/updateBy",
    method: "post",
    data: data || {}
  });
}

//  分页查询消费记录
export function payRecByPage(data) {
  return request({
    url: market + "/card/payRecByPage",
    method: "post",
    data: data || {}
  });
}

// 分页查询充值记录
export function recordByPage(data) {
  return request({
    url: market + "/card/recordByPage",
    method: "post",
    data: data || {}
  });
}

// 根据卡号查看已绑定计费组
export function queryCardGroupList(data) {
  return request({
    url: market + "/card/queryCardGroupList",
    method: "get",
    params: data || {}
  });
}
// 绑定车辆
export function updateEvId(data) {
  return request({
    url: market + "/card/updateEvId" + data,
    method: "post",
    // data: data || {}
  });
}

// 重置密码
export function updatePayPass(data) {
  return request({
    url: market + "/card/updatePayPass",
    method: "get",
    params: data || {}
  });
}

// 充值
export function updateRecharge(data) {
  return request({
    url: market + "/card/updateRecharge",
    method: "post",
    data: data || {}
  });
}
// 副卡表获取
export function listByPageCard(data) {
  return request({
    url: market + "/card/listByPageCard",
    method: "post",
    data: data || {}
  });
}
// 解绑车辆
export function updateEv(data) {
  return request({
    url: market + "/card/updateEv" + data,
    method: "post",
    // data: data || {}
  });
}

// 查看卡号绑定车辆
export function getCardEv(data) {
  return request({
    url: market + "/card/getCardEv",
    method: "get",
    params: data || {}
  });
}

// 迷糊查询卡绑定车辆
// export function getVin(carNum) {
//   return request({
//     url: market + `/card/getVin/${carNum}`,
//     method: "get",
//   });
// }
export function getVin(data) {
  return request({
    url: "property/assetEv/queryEvList",
    method: "post",
    data: data || {}
  });
}
// 根据车牌号查询车辆自编号
export function getAssetNo(carNum) {
  return request({
    url: `property/assetEv/getVin/${carNum}`,
    method: "get",
  });
}
// 退款--保存
export function refund(data) {
  return request({
    url: market + "/card/refund",
    method: "post",
    data: data || {}
  });
}

// 退款消费记录查询

export function refundRecordByPage(data) {
  return request({
    url: market + "/card/refundRecordByPage",
    method: "post",
    data: data || {}
  });
}

// 卡修改已经绑定计费组
export function updateBillGroup(data) {
  return request({
    url: market + "/card/updateBillGroup",
    method: "post",
    data: data || {}
  });
}

// 查看充值金额折扣
export function queryDiscount(data) {
  return request({
    url: market + "/preferentialModel/queryDiscount",
    method: "post",
    data: data || {}
  });
}

// 开票表单数据获取接口
export function listBysPages(data) {
  return request({
    url: market + "/issueInvoiceRec/listByPage",
    method: "post",
    data: data || {}
  });
}

// 开票表单数据--- 新增
export function save(data) {
  return request({
    url: market + "/issueInvoiceRec/save",
    method: "post",
    data: data || {}
  });
}

// 开票表单数据--- 修改
export function update(data) {
  return request({
    url: market + "/issueInvoiceRec/update",
    method: "post",
    data: data || {}
  });
}

// 开票表单数据--- 根据名称模糊查询通用主表
export function listTaxnumBuyInfo(data) {
  return request({
    url: market + "/issueInvoiceRec/listTaxnumBuyInfo",
    method: "get",
    params: data || {}
  });
}

// 开票表单数据 --- 批量删除
export function remove(params) {
  return request({
    url: market + "/issueInvoiceRec/remove",
    method: "delete",
    data: params
  });
}

// 开票数据获取 --- 用户信息
export function queryById(id) {
  return request({
    url: market + `/indAccInfoAction/queryById/${id}`,
    method: "get",
  });
}

// 根据手机查询用户
export function initAllByPhone(data) {
  return request({
    url: market + "/indAccInfoAction/initAllByPhone",
    method: "post",
    data: data || {}
  });
}

// 电卡信息导出

export function exportClient(data) {
  return request({
    url: market + "/card/exportClient",
    method: "post",
    data: data || {}
  });
}

// 选择金额-- 充电记录（不分页）
export function queryChargingListCondition(data) {
  return request({
    url: "charge/chagRec/queryChargingListCondition",
    method: "post",
    data: data || {}
  });
}

// 金额--分页消费记录
export function queryChargingList(data) {
  return request({
    url: "charge/chagRec/queryChargingList",
    method: "post",
    data: data || {}
  });
}

// 副卡导出
export function subCardExportClient(data) {
  return request({
    url: market + "/card/subCardExportClient",
    method: "post",
    data: data || {}
  });
}